package n2531;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	
	static int [][] node=new int[20][20];
	
	static boolean visit[]=new boolean[20];
	
	static int n;
	
	static int max=-1;
	
	static void dfs(int k,int cnt)
	{
		if(k>=n)return;
		if(cnt>max)max=cnt;
		visit[k]=true;
		int t=cnt;
		for(int i=0;i<n;i++)
		{
			if(visit[i]) {
				t-=node[k][i];
			}else {
				t+=node[k][i];
			}
		}
		dfs(k+1,t);
		visit[k]=false;
		dfs(k+1,cnt);
	}
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		String line=bf.readLine();
		n=Integer.parseInt(line);
		for(int i=0;i<n;i++)
		{
			line=bf.readLine();
			StringTokenizer st=new StringTokenizer(line);
			for(int j=0;j<n;j++)
			{
				node[i][j]=Integer.parseInt(st.nextToken());
			}
		}
		dfs(0,0);
		System.out.println(max);
	}

}
